import java.util.Scanner;

public class returnbook implements doOperation {
    @Override
    public void work(booklist bl) {
        System.out.println("请输入你要归还的书名");
        String name;
        Scanner p=new Scanner(System.in);
        name=p.nextLine();

        for(int i=0;i<bl.getUsedsize();i++)
        {
            book a=bl.getbook(i);
            if(a.getName().equals(name)){
                if(a.isIsborrowed()){
                    a.setIsborrowed(false);
                    System.out.println("归还成功");
                    return;
                }

            }
        }
        System.out.println("没有你要归还的书籍");

    }
}
